/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import java.io.IOException;
/*     */ import java.io.InputStream;
/*     */ import java.nio.ByteBuffer;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.resources.IResource;
/*     */ import net.minecraft.util.ResourceLocation;
/*     */ import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
/*     */ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
/*     */ import net.minecraftforge.fml.common.gameevent.TickEvent;
/*     */ import org.lwjgl.LWJGLException;
/*     */ import org.lwjgl.input.Cursor;
/*     */ import org.lwjgl.input.Mouse;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ @EventBusSubscriber(modid = "dragoncore")
/*     */ public class oa
/*     */ {
/*     */   public static Cursor w;
/*     */   public static Cursor q;
/*     */   public static boolean g;
/*     */   
/*     */   @SubscribeEvent
/*     */   public static void v(TickEvent.ClientTickEvent a) {
/*  28 */     if (a.phase == TickEvent.Phase.END)
/*     */       return; 
/*  30 */     v();
/*     */   }
/*     */ 
/*     */   
/*     */   public static void z() {
/*     */     try {
/*  36 */       IResource a = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("dragoncore", "Mouse.png"));
/*  37 */       w = v(a.func_110527_b());
/*  38 */       Mouse.setNativeCursor(w);
/*  39 */     } catch (Throwable a) {
/*  40 */       if (a instanceof java.io.FileNotFoundException) {
/*  41 */         nm.m.d("鼠标替换贴图文件不存在,替换失败->Mouse.png");
/*     */       } else {
/*  43 */         nm.m.v("Failed to load and apply cursor.", a);
/*     */       } 
/*     */     } 
/*     */     try {
/*  47 */       IResource a = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("dragoncore", "Mouse_Click.png"));
/*  48 */       q = v(a.func_110527_b());
/*  49 */     } catch (Throwable a) {
/*  50 */       q = w;
/*  51 */       if (a instanceof java.io.FileNotFoundException) {
/*  52 */         nm.m.d("鼠标替换贴图文件不存在,替换失败->Mouse_Click.png");
/*     */       } else {
/*  54 */         nm.m.v("Failed to load and apply cursor_click.", a);
/*     */       } 
/*     */     } 
/*  57 */     g = false;
/*     */   }
/*     */   
/*     */   public static void v() {
/*  61 */     boolean a = Mouse.isButtonDown(0);
/*  62 */     if (g == a) {
/*     */       return;
/*     */     }
/*  65 */     g = a;
/*  66 */     Cursor cursor = a ? q : w;
/*  67 */     if (cursor != null) {
/*     */       try {
/*  69 */         Mouse.setNativeCursor(cursor);
/*  70 */       } catch (Exception exception) {}
/*     */     }
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public static Cursor v(InputStream a) throws IOException, LWJGLException {
/*  77 */     int i = 0;
/*  78 */     int j = 0;
/*  79 */     vj vj = new vj();
/*     */     
/*  81 */     vj.v(false);
/*     */     
/*  83 */     ByteBuffer byteBuffer = vj.v(a, true, true, (int[])null); int k;
/*  84 */     for (k = 0; k < byteBuffer.limit(); k += 4) {
/*  85 */       byte b1 = byteBuffer.get(k);
/*  86 */       byte b2 = byteBuffer.get(k + 1);
/*  87 */       byte b3 = byteBuffer.get(k + 2);
/*  88 */       byte b4 = byteBuffer.get(k + 3);
/*     */       
/*  90 */       byteBuffer.put(k + 2, b1);
/*  91 */       byteBuffer.put(k + 1, b2);
/*  92 */       byteBuffer.put(k, b3);
/*  93 */       byteBuffer.put(k + 3, b4);
/*     */     } 
/*     */     
/*     */     try {
/*  97 */       k = vj.t() - j - 1;
/*  98 */       if (k < 0) {
/*  99 */         k = 0;
/*     */       }
/*     */       
/* 102 */       return new Cursor(vj.z(), vj.h(), i, k, 1, byteBuffer.asIntBuffer(), null);
/* 103 */     } catch (Throwable throwable) {
/* 104 */       nm.m.d("Chances are you cursor is too small for this platform");
/* 105 */       throw new LWJGLException(throwable);
/*     */     } 
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\oa.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */